package com.oet.persistence.entity;

// Generated Feb 6, 2010 3:22:38 PM by Hibernate Tools 3.2.4.GA

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * YdkAccount generated by hbm2java
 */
@Entity
@Table(name = "teacher", catalog = "oet")
public class Teacher implements java.io.Serializable {

	private Long id;
	private String name;
	private String email;
	private String mobilePhone;
	private Integer level;
	private String thumbnail;
	private Date birthday;
	private Double payFactor;
	private String password;
	private Double score;
	private Integer scoredNumber;
	private Integer totalCourseNumber;
	private String movie;
	
	private Boolean isActived;
	private Date lastAccessed;
	private String description;
	
	private List<CourseSeries> courseSeriess = new ArrayList<CourseSeries>(0);

	public Teacher() {
	}





	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}



	@Column(name = "name", nullable = false, length = 250)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	

	/**
	 * @return the password
	 */
	@Column(name = "password", length = 50)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	

	@Column(name = "email", nullable = false, length = 80)
	public String getEmail() {
		return this.email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Column(name = "is_actived")
	public Boolean getIsActived() {
		return this.isActived;
	}
	public void setIsActived(Boolean isActived) {
		this.isActived = isActived;
	}

	/**
	 * @return the lastAccessed
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_accessed")
	public Date getLastAccessed() {
		return lastAccessed;
	}
	public void setLastAccessed(Date lastAccessed) {
		this.lastAccessed = lastAccessed;
	}

	@Column(name = "mobile_phone", length=50)
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	@Column(name = "thumbnail", length=250)
	public String getThumbnail() {
		return thumbnail;
	}
	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}

	@Column(name = "pay_factor")
	public Double getPayFactor() {
		return payFactor;
	}
	public void setPayFactor(Double payFactor) {
		this.payFactor = payFactor;
	}

	@Column(name = "score")
	public Double getScore() {
		return score;
	}
	public void setScore(Double score) {
		this.score = score;
	}

	@Column(name = "scored_number")
	public Integer getScoredNumber() {
		return scoredNumber;
	}
	public void setScoredNumber(Integer scoredNumber) {
		this.scoredNumber = scoredNumber;
	}

	@Column(name = "total_course_number")
	public Integer getTotalCourseNumber() {
		return totalCourseNumber;
	}
	public void setTotalCourseNumber(Integer totalCourseNumber) {
		this.totalCourseNumber = totalCourseNumber;
	}


	@Column(name = "movie", length=250)
	public String getMovie() {
		return movie;
	}
	public void setMovie(String movie) {
		this.movie = movie;
	}


	@Column(name = "description")
	@Lob
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "birthday")
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	
	@Column(name = "level")
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}


	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacher")
	@JoinTable(
            name="teacher_course_series",
            joinColumns = @JoinColumn( name="course_series_pk"),
            inverseJoinColumns = @JoinColumn( name="teacher_pk")
    )
    @OrderBy("id desc")
	public List<CourseSeries> getCourseSeriess() {
		return courseSeriess;
	}
	public void setCourseSeriess(List<CourseSeries> courseSeriess) {
		this.courseSeriess = courseSeriess;
	}
	
	
	
	
	
	
	
	
	

}
